﻿using FactoryMode.Calculator;
using System;

namespace FactoryMode
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入第一个数");
            var num1 = Console.ReadLine();
            Console.WriteLine("请输入第二个数");
            var num2 = Console.ReadLine();
            Console.WriteLine("请输入操作符号");
            var operationStr = Console.ReadLine();
            //通过工厂创建操作类
            var operation = OperationFactory.CreateOperation(operationStr.GetOperationType());
            operation.NumberOne = Convert.ToDouble(num1);
            operation.NumberTwo = Convert.ToDouble(num2);
            Console.WriteLine($"{num1}{operationStr}{num2}={operation.GetResult()}");

            Console.WriteLine("Hello World!");
        }
    }
}
